/*
 * Exploder
 * 
 * Tero Pyylampi (218437), Jussi Tuurinkoski (211594)
 *
 * Main game scene
 */

#ifndef GAMESCENE_H
#define GAMESCENE_H

#include "cocos2d.h"

class MainEngine;
class GameCamera;
class LayerBackground;
class LayerGame;
class LayerInterface;
class Dialog;

class GameScene : public cocos2d::CCScene
{
public:
	// default constructor
	GameScene( MainEngine *mainEngine, int level );
	// default destructor
	~GameScene();

	// initialize this scene
	void initScene();

	// update -function
	virtual void update( cocos2d::ccTime dt );
	
	// get main engine
	MainEngine *getMaster();
	// get game layer
	LayerGame *getGameLayer();
	// get interface layer
	LayerInterface *getInterfaceLayer();

	// get level
	char *getCurrentLevel();

	// show level cleared dialog
	void showLevelClearedDialog();
	// show level failed dialog
	void showLevelFailedDialog();

	// callback functions for dialog
	void restartCallback( cocos2d::CCObject *pSender );
	void backToMenuCallback( cocos2d::CCObject *pSender );
	void nextLevelCallback( cocos2d::CCObject *pSender );

	// background layer
	LayerBackground *getLayerBackground();

private:
	// pointer to the master engine
	MainEngine *mMaster;
	// camera used
	GameCamera *mGameCamera;

	// parallax node for the layers
	cocos2d::CCParallaxNode *mParallaxNode;
	// layers used
	LayerBackground *mBackgroundLayer;
	LayerGame *mGameLayer;
	LayerInterface *mInterfaceLayer;

	// level currently loaded
	int mCurrentLevel;

	// dialog for level cleared & failed information
	Dialog *mDialog;
};

#endif